using System;
using System.Runtime.InteropServices;

namespace ScenarioFramework.WAPI
{
	/// <summary>
	/// Summary description for DataBase.
	/// </summary>
	public class Session
	{
		/// <summary>
		/// m_iTestVar is a module level test variable for storing int 
		/// </summary>
		private const string WORKFLOWPROCESS_DIRECTORY = "WorkflowProcesses";

		/// <summary>
		/// Initializes a new instance  of the <see cref="Session"/> class.
		/// </summary>
		public Session()
		{
		}

        private void Startup()
        {
            Response wapiResponse = new Response();

            InitSession(ref wapiResponse);

            if (wapiResponse.iCode != 00)
            {
            }
        }

		/// <summary>
		/// Inits the session.
		/// </summary>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport( "WAPI.dll", EntryPoint="InitSession" )]
		private static extern IntPtr InitSession(ref Response response);

		/// <summary>
		/// Inits the session.
		/// </summary>
		/// <param name="response">The response.</param>
		/// <param name="sTraceName">Name of the s trace.</param>
		/// <param name="iTraceLevel">The i trace level.</param>
		/// <returns></returns>
		[ DllImport( "WAPI.dll", EntryPoint="InitSessionWithTrace" )]
		private static extern IntPtr InitSession(ref Response response, string sTraceName, int iTraceLevel);

		/// <summary>
		/// Ends the session.
		/// </summary>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport( "WAPI.dll", EntryPoint="EndSession" )]
		private static extern IntPtr EndSession(ref Response response);

		/// <summary>
		/// Helloes the world.
		/// </summary>
		[ DllImport( "WAPI.dll", EntryPoint="HelloWorld" )]
		private static extern void HelloWorld();

		/// <summary>
		/// Helloes the world message.
		/// </summary>
		/// <param name="response">The response.</param>
		[ DllImport( "WAPI.dll", EntryPoint="HelloWorldMessage" )]
		private static extern void HelloWorldMessage(ref Response response);

		/// <summary>
		/// Gets the directory.
		/// </summary>
		/// <param name="sDirectory">The s directory.</param>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport( "WAPI.dll", EntryPoint="GetDirectory" )]
		private static extern string GetDirectory(string sDirectory, ref Response response);

		/// <summary>
		/// Gets the scenario execution directory.
		/// </summary>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport( "WAPI.dll", EntryPoint="GetScenarioExecutionDirectory" )]
		private static extern string GetScenarioExecutionDirectory(ref Response response);

		/// <summary>
		/// Gets the scenario DB directory.
		/// </summary>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport( "WAPI.dll", EntryPoint="GetScenarioDBDirectory" )]
		internal static extern string GetScenarioDBDirectory(ref Response response);

	}
}
